#include<iostream>
using namespace std;

FILE*output;
output=fopen("guest.txt","w");
if(output==NULL){
cout<<"Error in creating output file"<<endl;
return -1;

void guest(int roll[500],int account[500])
{
	int flag=0;
      char date[10];
	int rollno,no;
	int ch;float accountgb[8];
	cout<<"Welcome"<<endl;
	while(flag!=1)
	{
      cout<<"Please enter today's date (dd-mm-yy): ";
      cin>>date[10];
	cout<<"Enter the roll number of the student"<<endl;
	cin>>rollno;
	for(i=0;i<n;i++)
	{
		if(roll[i]==rollno)
		{
			flag=1;
			break;
		}
	}
	if(flag==0)
	cout<<"Invalid Roll number.Please enter correct roll number"<<endl;
	}
     cout<<"how many guest want facility?"<<endl;
     cin>>no;
	cout<<"Which facility would you like to avail?"<<endl;
	cout<<"1.Breakfast(Rs 30)"<<endl;
	cout<<"2.Lunch(Rs 50)"<<endl;
	cout<<"3.Dinner(Rs 50)"<<endl;
     
	cout<<"Press appropriate choice"<<endl;
	cin>>ch;
	switch(ch)
	{
	case 1:
	accountgb[i]=account[i]+no*30;
	fprintf(output,"%s\t%d\tbreakfast date[],no,)
break;
	case 2:
	accountgb[i]=account[i]+no*50;
	fprintf(output,"%s\t%d\tlunchdate[],no,)break;	
	case 3:
	accountgb[i]=account[i]+no*50;
fprintf(output,"%s\t%d\tdinner date[],no,
	break;
	default:
	cout<<"Invalid choice"<<endl;
	
}
	cout<<"The account balance after the transaction is "<<account[i]<<endl;
	cout<<"Thank you"<<endl;
}
			
